<?php

define('G_DEBUG_MODE', false);
define('G_BIN_CHECK_INCLUDE', 1);
include 'common.inc.php';



if($_POST['host'] && $_POST['user'] && $_POST['p'])
{
	$s = float_time();
	$link = mysql_connect($_POST['host'], $_POST['user'], $_POST['p']);
	
	var_dump('link db '.($link ? 'ok' : 'false').' :'.(float_time() - $s));
	
	if($_POST['query'])
	{
		$s = float_time();
		mysql_query($_POST['query'], $link);
		var_dump('query :'.(float_time() - $s));
	}
}
?>

<form method="POST" enctype="multipart/form-data">
	<p>host: <input name="host" type="text" value="<?php echo $_POST['host']; ?>">
	<p>user: <input name="user" type="text" value="<?php echo $_POST['user']; ?>">
	<p>p: <input name="p" type="password" value="<?php echo $_POST['p']; ?>">
	<p>query: <textarea name="query"><?php echo $_POST['query']; ?></textarea>
	<p><input  type="submit">
	
</form>



